home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PROGRAM
/
CUJ9104.ARJ
/
9N04075A
< prev
next >
Wrap
Text File
|
1991-02-19
|
848b
|
31 lines
/********************************************************************/
/* Test the boolean class. */
/********************************************************************/
#include <iostream.h>
#include <boolean.hpp>
char *test(int i) { return i ? "okay.\n" : "not okay.\n"; }
main()
{
boolean b1,b2;
cout << "Testing boolean class\n";
cout << "Constructed value and int() is " << test(b1 == FALSE);
cout << "Comparison is " << test(b1 == b2);
b1 = 1;
cout << "Operator=() is " << test(b1 == true);
b1 = ~b2;
cout << "Operator~() is " << test(b1 == true);
b1++;
cout << "Operator++() is " << test(b1 == false);
b1--;
cout << "Operator--() is " << test(b1 == true);
cout << "Make_string() is " << b1.make_string() << "ly okay.\n";
true = false; // This only produces warning message.
}